Debt Algorand Standard Application
A standard for debt instruments tokenization on Algorand
The Debt Algorand Standard Application (D-ASA) is a standard for tokenizing debt instruments on the Algorand Virtual Machine.
It provides the interfaces for arranging the asset, configuring its role-based access control, issuing and distributing it on the primary market, executing cash flows, exchanging it on the secondary market, and querying information about the debt instrument.
The specification allows the tokenization of various debt instruments, such as bonds, loans, commercial papers, mortgages, etc. A reference implementation of some payoff examples is provided.
This document is a technical specification, it is not to be intended as a legal or a financial document.
Contributing
The D-ASA is free and open source. The source code is released on the official GitHub repository. External contributions are welcome, the project relies on the community to improve and expand. Issues and features requests can be submitted on the GitHub issues page. If you would like to contribute, please consider submitting a pull request.
License
The D-ASA source and documentation are released under the AGPL-3.0 license.
Motivation
Debt instruments represent one of the biggest asset classes (along with equities, commodities, and real estate). Debt instruments are investment contracts between borrowers and lenders, used to raise capital with binding obligations between the parties, who agree on the payoff and the cash flows (payments schedule, interest rates, maturity, etc.).
The definition of a comprehensive specification for the tokenization of debt instruments benefits several players of the traditional value chain, such as issuers, arrangers, asset managers, risk managers, lenders, payment agents, transfer agents, etc.
The Debt Algorand Standard Application turns a traditional debt instrument into a deterministic financial contract, executed on the Algorand Virtual Machine (AVM). The machine-readable and executable contract removes existing frictions over the debt instruments lifecycle and reconciliation, enabling use cases such as truly atomic delivery-vs-payment (with instant finality and no counterparty risk), deterministic cash flows analysis (when, how much, to whom), and easier quantitative risk management.
Definitions
The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
The data types (like uint64
, byte[]
, etc.) in this document are to be interpreted
as specified in ARC-4.
Notes like this are non-normative
Non-normative sections mainly contextualize the specification for technical readers unfamiliar with the financial concepts described.
๐ EXAMPLE
Sections like this are examples aiming to clarify the specifications.
Sections like this are either pseudo-code or formal examples.
Overview
A Debt Algorand Standard Application (D-ASA) is a debt instrument issued as an Algorand Application, that conforms to this specification, and whose operations and cash flows are executed on the AVM.
This specification defines the actors of a D-ASA and the interfaces of the Algorand Application to:
- Arrange and configure the D-ASA (e.g. principal, interest, time events, etc.);
- Manage D-ASA accounts (e.g. opening and closing accounts, etc.);
- Distribute the D-ASA on the primary market (e.g. book building, auctions, etc.);
- Execute D-ASA cash flows (e.g coupon payments, principal repayment, etc.);
- Exchange the D-ASA on secondary markets (if any);
- Query D-ASA information (e.g. due coupons, next coupon due date, etc.).
This specification also provides the interfaces to comply with regulatory requirements, such as defining a role-based access control, suspending D-ASA operations completely or for specific accounts, managing default processes, etc.
The contents are structured on four functional layers:
- Trust Model: this layer defines the application role-based access control model to manage the fixed income contract and comply with regulatory frameworks;
- Contract: this layer provides the algorithmic definitions of the debt instrument (data model, attributes, and cash flows);
- Ownership: this layer defines the tokenization of the contract;
- Execution: this layer defines the execution of the contract, both the distribution, cash flows and transfers.
Roles
D-ASA defines custom roles and permissions for the entities involved in the debt instrument.
Roles MUST be identified with a role ID (uint8
).
Roles MUST be associated with Algorand Addresses through a role key of the form:
[R||<role ID>||#||<role address>]
Where ||
denotes concatenation.
๐ EXAMPLE
Letโs have a D-ASA role ID
42
associated with the Algorand AddressXYZ
. The corresponding role key is42#XYZ
.
Issuer (Borrower)
Issuers are individuals, companies, institutions, governments, or other entities who borrow capital by issuing a debt.
An Issuer is an entity that owes a debt issued as D-ASA.
The Issuer role MUST be identified with the reserved ID 10
.
Arranger
Arrangers are legal entities authorized to arrange debt instruments on behalf of the issuers.
The Arranger owns an Algorand Address.
The Arranger role MUST be identified with the reserved ID 20
.
The Arranger SHALL configure the D-ASA using the asset_config
method.
The Arranger MAY configure the D-ASA role-based access control with the OPTIONAL
assign_role
and revoke_role
methods.
Investor (Lender)
Investors are lenders providing capital to borrowers with the expectation of a financial return, defined by debt instruments.
Investors own D-ASA accounts, characterized by a pair of Algorand Addresses:
- Holding Address: address that owns D-ASA units with the right to future payments;
- Payment Address: address that receives D-ASA payments.
The Payment Address MAY be different from the Holding Address.
D-ASA units can be in custody with a third party or temporarily deposited on an order book (Holding Address). At the same time payments are always executed towards the lender (on the Payment Address).
The right to open and close investor accounts can be granted to different entities, such as KYC providers or banks.
The Investor role MUST be identified with the reserved ID 30
.
Open Account
The D-ASA accounts SHALL be opened using the open_account
method.
The D-ASA accounts MUST NOT be opened if the D-ASA is suspended (see Suspension section).
The D-ASA accounts MUST NOT be opened if the D-ASA is in default (see Default section).
Close Account
The D-ASA accounts MAY be closed using the close_account
method.
The D-ASA accounts MUST NOT be closed if the D-ASA is in default (see Default section).
Role-Based Access Control
D-ASA can define a custom role-based access control to comply with administrative and regulatory requirements.
A D-ASA role MAY be assigned using the OPTIONAL assign_role
method.
A D-ASA role MAY be revoked using the OPTIONAL revoke_role
method.
Regulations
Debt instruments are regulated under different legal frameworks and their jurisdictions.
The D-ASA ensures efficient execution of the debt instrument in the "best case scenarios", where it offers the highest improvements on cost and time efficiency if compared to the traditional, manual, and labor-intensive contracts.
The D-ASA provides methods to comply with regulatory obligations, allowing the management of the "worst case scenarios", in which the intervention of the authority or the regulator is necessary.
Suspension
Debt instruments can be temporarily suspended due to regulations or operational reasons.
Asset Suspension
The D-ASA MAY suspend all:
- Payments;
- D-ASA units transfers.
The asset suspension status MUST be set with the set_asset_suspension_status
method.
Account Suspension
The D-ASA MAY suspend account:
- Payments (skipped on due dates);
- D-ASA units transfers (from and to).
The account suspension status MUST be set with the set_account_suspension_status
method.
Default
Debt instruments are exposed to default risks.
Default is the failure to pay the lenders according to the payment obligations.
Default processes require the intervention of regulatory bodies and courts, therefore the D-ASA default status bridges the default process off-chain.
The D-ASA SHOULD enter default status if it cannot perform payments on due dates.
The D-ASA MAY disable all non-administrative methods on default status.
The D-ASA default can be called either automatically (based on program conditions) or manually (based on the decision of a trustee).
The default status MAY be set with the OPTIONAL set_default_status
method.
๐ EXAMPLE
A D-ASA coupon payment is triggered on due date, but there is not enough liquidity to pay all the investors. The D-ASA contract automatically enters in default immediately.
๐ EXAMPLE
A D-ASA coupon payment is triggered on due date, but there is not enough liquidity to pay all the investors. The D-ASA program increments a failed payments counter and waits 3 hours to retry. If the D-ASA has three failed payments in a row, then the contract automatically enters in default.
๐ EXAMPLE
A D-ASA coupon payment is triggered on due date, but there is not enough liquidity to pay all the investors. The D-ASA contract relies on a trustee to call the default.
Denomination
Debt instruments are denominated in a currency, in which principal and interests are calculated.
The D-ASA MUST be denominated either in an on-chain or off-chain denomination asset.
The denomination asset identifier (uint64
) MUST be set using the asset_config
method.
On-chain denomination
The denomination asset MUST be an Algorand Standard Asset (ASA), an Application asset (App), or the ALGO.
The denomination asset identifier MUST be the ASA ID, the App ID, or 0
for
ALGO.
Off-chain denomination
The denomination asset identifier MUST the ISO 4217 currency numeric code.
The denomination asset MUST use the decimal digits specified by the ISO 4217.
Settlement
Debt instruments cash flows may be settled in a currency different from the denomination.
The D-ASA MUST define either in an on-chain or off-chain settlement asset to regulate the cash flows.
The settlement asset identifier (uint64
) MUST be set using the asset_config
method.
If the D-ASA defines a settlement asset different from the denomination asset, then the respective denomination/settlement conversion rate is applied at settlement time.
The denomination/settlement conversion rate can be provided by different oracles, depending on if the denomination/settlement assets are on-chain or off-chain.
If the D-ASA does not define a different settlement asset, then the cash flows MUST be settled in the denomination asset and the settlement asset identifier MUST be equal to the denomination asset identifier.
On-chain settlement
The settlement asset MUST be an Algorand Standard Asset (ASA), an Application asset (App), or the ALGO.
The settlement asset identifier MUST be the ASA ID, the App ID, or 0
for
ALGO.
On-chain settlement is possible even if the denomination asset is a traditional off-chain currency.
Off-chain denomination
The settlement asset identifier MUST the ISO 4217 currency numeric code.
The settlement asset MUST use the decimal digits specified by the ISO 4217.
In the case of an off-chain settlement, the D-ASA state machine:
- Regulates paymentsโ approval conditions (e.g. a coupon is due);
- Notarizes the amounts and timestamps of payments settled off-chain.
Principal (Par)
Debt instruments principal is the amount of capital borrowed and used as a base for calculating interest.
The D-ASA MAY define the principal (uint64
), expressed in the denomination
asset.
If the D-ASA has a principal, it MUST define a minimum denomination (uint64
),
expressed in the denomination asset.
The minimum denomination MUST be a divisor of the principal.
The principal and the minimum denomination MUST be set using the asset_config
method.
If the D-ASA has no defined principal, the principal and the minimum denomination
MUST be set to 0
.
Interests
Debt instruments interest is calculated on a fixed or variable rate on the outstanding principal.
The interest rate is the nominal yield paid by the debt instrument on the principal, usually expressed as Annual Percentage Yield (APY).
The D-ASA interest rates MUST be defined in basis points (bps).
Interest Rate
The D-ASA MUST define an interest rate (uint16
).
Coupons
Debt instruments can pay interest in periodic installments, called coupons.
Coupons mature in a coupon period, according to a defined coupon schedule.
The D-ASA MUST define the number of total coupons K
(uint64
):
K>0
if the D-ASA has a defined number of coupons;K=0
if the D-ASA has zero or undefined (perpetual) coupons.
Coupon Rates
Debt instruments can pay coupons with fixed or variable interest rates.
The D-ASA MAY define the coupon rates as uint16[]
array, where:
- The length of the array MUST be
K
, equal to the total coupons; - The
K
-elements of the array are the coupon rates, expressed in bps.
If the D-ASA has zero or undefined coupons (K=0
), the coupon rates array MUST
be empty and the interest rate MUST be used instead.
Coupon rates could be derived from the interest rate.
๐ EXAMPLE
D-ASA with 4 coupons with the following rates: 2,00%, 2,50%, 3,00%, and 3,50% would have the following coupon rates array (bps):
uint64[] = [200, 250, 300, 350]
๐ EXAMPLE
D-ASA with zero coupons would have the following coupon rates array (bps):
uint64[] = []
The coupon rates MUST be set using the asset_config
method.
Variable Rates
The interest rate MAY be updated using the OPTIONAL update_interest_rate
method.
If the D-ASA has coupons, the interest rate MUST NOT be updated if there is any due coupon still to be paid.
The coupon rates MAY be updated using the OPTIONAL update_coupon_rates
method.
The updated coupon rates MUST NOT modify past coupon rates.
A reference implementation SHOULD properly restrict the coupon rate updatability.
๐ EXAMPLE
A D-ASA has variable interest rates pegged to an off-chain index. Interest update permissions are granted to an external interest oracle.
๐ EXAMPLE
A D-ASA has variable interest rates based on covenant breaches. Interest update permissions are granted to a trustee in charge of verifying breaches.
Accruing Interest
Debt instruments may accrue interest over time.
The D-ASA units MAY accrue interest, according to the day-count convention (see Day-Count Convention section).
If the D-ASA has coupons, the units accrued interest MUST be calculated with respect to the latest coupon due date.
๐ EXAMPLE
Let's have a D-ASA with
4
coupons. The 2nd coupon is due. The D-ASA units are accruing the interest of the 3rd coupon. The accrued interest is calculated according to the day-count convention, applied to the elapsed time with respect to the 2nd coupon due date.
If the D-ASA has coupons, the account units accrued interest calculation SHOULD fail if it has pending coupon payments.
๐ EXAMPLE
Let's have a D-ASA with
4
coupons. The 2nd coupon is due. The D-ASA units are accruing the interest of the 3rd coupon. Coupon payments are not executed synchronously for all the Lenders. The 2nd coupon payment is executed for Lender A, while Lender B is still waiting for the payment settlement. The accrued interest calculation succeeds for Lander A and fails for Lender B until the 2nd coupon payment is settled.
Time Schedule
Debt instruments may have fixed or variable time events (e.g. variable coupon due date, etc.).
Debt instruments may have a defined or undefined number of time events (e.g. a fixed coupon bond or a perpetual bond).
Time on the AVM can be expressed as the block's height (round) or blockโs timestamp (UNIX time). The blockโs time is dynamic, so D-ASA based on the blockโs height could present a drift with external time references.
Primary Distribution
Debt instruments can be distributed on the primary market during the primary distribution.
The opening and closure dates define the primary distribution duration.
The D-ASA MUST have a primary opening and closure date.
Issuance
Debt instruments start accruing interest on the issuance date.
The D-ASA MUST have an issuance date.
Maturity
Debt instruments may have a maturity date, on which the principal is repaid and the contract obligations expire.
Debt instruments may have a fixed or variable maturity date.
The D-ASA MAY have a maturity date.
Time Events
The D-ASA MUST define time events as uint64[]
array, where:
-
The length of the array MUST be:
N=K+4
, if the D-ASA has a maturity date;N=K+3
, if the D-ASA has not a maturity date;
with
K
equal to the total coupons. -
The first element MUST be the primary distribution opening date (
uint64
): the time at which the D-ASA primary distribution opens; -
The second element MUST be the primary distribution closure date (
uint64
): the time at which the D-ASA primary distribution closes; -
The third element MUST be the issuance date (
uint64
): the time at which D-ASA starts to accrue interest on the principal; -
If the D-ASA has a defined number of coupons, the next
K
-elements MUST be the coupon due dates (uint64[K]
): times at which the D-ASA can pay coupons; -
If the D-ASA has a maturity date, the last element MUST be the maturity date (
uint64
).
The time events MUST be sorted in strictly ascending order.
The time events SHOULD be defined as UNIX time, in seconds.
In the case of time events defined in UNIX time and non-continuous day-count
conventions (ID<255
, see Day-Count Conventions section),
the time periods between subsequent events MUST be multiples of a day, in
seconds (86400
).
The time events MUST be set using the asset_config
method.
๐ EXAMPLE
The following are valid time events (UNIX times):
uint64[] = [1704067200, 1735603200, 1767139200, 1798675200, 1830211200]
๐ EXAMPLE
The following are invalid (respectively unsorted and not-strictly sorted) time events (UNIX times):
uint64[] = [1830211200, 1704067200, 1735603200, 1767139200, 1798675200]
uint64[] = [1704067200, 1735603200, 1767139200, 1798675200, 1830211200, 1830211200]
๐ EXAMPLE
A D-ASA with
K
total coupons and a defined maturity date, has the following time events:uint64[] = [primary_distribution_opening_date, primary_distribution_closure_date, issuance_date, cupon_due_date_1, ..., coupon_due_date_K, maturity_date]
๐ EXAMPLE
A D-ASA whose primary distribution lasts from December 1st, 2023 00:00:00 GMT+0 to December 15th, 2023 00:00:00 GMT+0, is issued on January 1st, 2024 00:00:00 GMT+0 and matures on January 1st, 2028 00:00:00 GMT+0, with 4 annual coupons, each paid on December 31st 00:00:00 GMT+0, has the following time events array (UNIX times):
uint64[] = [1701388800, 1702598400, 1704067200, 1735603200, 1767139200, 1798675200, 1830211200, 1830297600]
๐ EXAMPLE
A D-ASA whose primary distribution lasts from December 1st, 2023 00:00:00 GMT+0 to December 15th, 2023 00:00:00 GMT+0, is issued on January 1st, 2024 00:00:00 GMT+0 and matures on January 1st, 2028 00:00:00 GMT+0, with zero coupons, has the following time events array (UNIX times):
uint64[] = [1701388800, 1702598400, 1704067200, 1830297600]
๐ EXAMPLE
A D-ASA whose primary distribution lasts from December 1st, 2023 00:00:00 GMT+0 to December 15th, 2023 00:00:00 GMT+0, is issued on January 1st, 2024 00:00:00 GMT+0 and no maturity, with perpetual coupons, has the following time events array (UNIX times):
uint64[] = [1701388800, 1702598400, 1704067200]
Time Periods
D-ASA time periods can be used to define recurring time events.
The D-ASA MAY define time periods as (uint64,uint64)[]
array, where:
-
The first element of the tuple defines the time period duration (
uint64
). It MUST be strictly greater than0
; -
The second element of the tuple defines the time period repetitions (
uint64
). It MUST be0
if repetitions are unlimited.
The time periods SHOULD be defined as UNIX time, in seconds.
In the case of time periods defined in UNIX time and non-continuous day-count
conventions (ID<255
, see Day-Count Conventions section), the time periods
MUST be multiples of a day, in seconds (86400
).
The time periods MAY be set using the asset_config
method.
If the D-ASA does not implement time periods, it MUST be set to []
in the
asset_config
method.
๐ EXAMPLE
The following are valid time periods (UNIX times) indicating:
- a daily time event with unlimited repetitions
- a monthly (30 days) time event with 12 repetitions
(uint64,uint64)[] = [(86400, 0), (2592000, 12)]
๐ EXAMPLE
The following are invalid time periods (UNIX times):
(uint64,uint64)[] = [(0, 0), (0, 12)]
The time periods MUST be chronologically consistent with respect to the time events.
๐ EXAMPLE
Let's have a D-ASA with an issuance date and a maturity date, defined as time events, and 4 coupons whose periods are defined by time periods.
The sum of the 4 coupon time period durations must be smaller than the time period between the issuance date and the maturity date.
Variable Time Schedule
Debt instruments can have variable time schedule, based on different contract terms, such as covenants, etc.
Variable Time Events
The time events MAY be updated with the OPTIONAL update_time_events
method.
The updated time events MUST NOT modify past events.
A reference implementation SHOULD restrict the time events updatability.
๐ EXAMPLE
Let's have a D-ASA with a maturity date and 4 coupons, defined by time events. The 2nd coupon is due.
The updated time events can no longer modify:
- the primary distribution opening date;
- the primary distribution closure date;
- the issuance date;
- the 1st and 2nd coupon due dates.
The updated time events can still modify:
- the 3rd and 4th coupon due dates;
- the maturity date.
Variable Time Periods
The time periods MAY be updated with the OPTIONAL update_time_periods
method.
The updated time periods MUST preserve chronological consistency with respect to the time events.
A reference implementation SHOULD restrict the time periods updatability.
๐ EXAMPLE
Let's have a D-ASA with an issuance date and a maturity date, defined as time events, and 4 coupons whose periods are defined by time periods.
The sum of the 4 updated coupon time period durations must be smaller than the time period between the issuance date and the maturity date.
Day-Count Convention
Debt instruments use a day-count convention to calculate the amount of accrued interest when the next coupon payment is less than a full coupon period away.
The D-ASA MUST specify one day-count convention.
The day-count convention MUST be identified with one of the following enumerate
IDs (uint8
):
ID | Name | Daily interest calculation description |
---|---|---|
10 | 30/360 | Using a 360-day year and 30-day months |
30 | 30/365 | Using a 365-day year and 30-day months |
50 | Actual/360 | Using a 360-day year and the actual number of days in each time period |
70 | Actual/365 | Using a 365-day year and the actual number of days in each time period |
100 | Actual/Actual | Using the actual number of days in each time period |
255 | Continuous | Using the actual number of time units in each time period |
The day-count convention defines the day-count factor as a fraction of:
- Numerator: elapsed time of the accrual period to date;
- Denominator: time of the full accrual period defined by the D-ASA time schedule.
The day-count convention MUST be set using the asset_config
method.
๐ EXAMPLE
Letโs have a D-ASA with time events defined as blockโs timestamps (UNIX time). The D-ASA has the following coupon dates:
date1
: starting date for the current couponโs interest accrual, defined by the D-ASA time schedule;date2
: date through which the interest is being accrued (โtoโ date), equals to the current block timestamp;date3
: next coupon due date, defined by the D-ASA time schedule.The day-count factor is calculated as:
Continuous convention (ID=
255
):(date2 - date1) / (date3 - date1)
Actual/Actual convention (ID=
100
):days_in(date2 - date1) / days_in(date3 - date1)
Where
days_in
returns the actual number of days (equal to86400
seconds) in the time interval.
Metadata
The D-ASA can notarize informative metadata like the debt instrument prospectus.
It is RECOMMENDED to use a digest of D-ASA data, instead of full clear text.
The D-ASA data digest MUST be computed with SHA-512/256, as defined in NIST FIPS 180-4.
The digests are a single SHA-256 integrity metadata defined in the W3C subresource integrity specification. Details on generating those digests can be found on the MDN Web Docs (only SHA-256 is supported by this specification).
The D-ASA metadata MAY be set using the OPTIONAL set_asset_metadata
method.
The D-ASA metadata MAY be updated using the OPTIONAL set_asset_metadata
method.
D-ASA units
D-ASA units represent the ownership of the tokenized debt instrument.
Supply
The D-ASA MUST define its total units (uint64
).
If the D-ASA has a principal, its initials total units MUST be equal to the principal divided by the minimum denomination.
๐ EXAMPLE
Letโs have a D-ASA denominated in EUR, with a principal of 1M EUR and a minimum denomination of 1,000 EUR. The D-ASA has 1,000 initial total units.
The D-ASA total units MAY be updated with the OPTIONAL update_total_units
method.
Value
The D-ASA unitโs value is always intended as nominal value (at redemption).
The D-ASA unit value (uint64
) MUST be expressed in the denomination asset.
If the D-ASA has a principal, its initial unit value MUST be equal to the minimum denomination.
The D-ASA unit value MAY change over time.
The D-ASA unitโs value may change according to different conditions, such as an amortizing principal repayment schedule (see Amortizing Schedule section).
The D-ASA unit value MAY change globally or locally (per account).
The D-ASA unitโs value can be global or local (per-account). Global unit value should be used when the value of all the units can be updated at the same time. Local unit value should be used when the units' value is updated at different times per each account.
๐ EXAMPLE
Letโs have a D-ASA denominated in EUR, with an initial unit value of 1,000 EUR. The D-ASA accrues interest on a daily basis, paid at redemption. The unit value is updated globally (for all the units).
๐ EXAMPLE
Letโs have a D-ASA denominated in EUR, with an initial unit value of 1,000 EUR. The D-ASA has an amortizing principal repayment schedule. Repayments are executed per-account. The unit value is updated per-account (for the accountโs units).
The D-ASA unit value MAY be globally updated with the OPTIONAL update_global_unit_value
method.
Fungibility
D-ASA units' fungibility depends on:
- Units value (nominal);
- Executed payments.
The D-ASA fungible units MUST have the same value and executed payments.
๐ EXAMPLE
Letโs have a D-ASA with 4 coupons. Lenders A and B are holding 10 D-ASA units each. The 1st coupon is due. Coupon payments are not executed synchronously for all the Lenders. The coupon payment is executed for Lender A, while Lender B is still waiting for the payment settlement. Lender A units are temporarily non-fungible with Lender B units until the 1st coupon is paid for both.
Primary Market
Debt instruments can be distributed on the primary market in different ways, such as book building, auctions, etc.
The D-ASA units MUST be distributed to D-ASA accounts, at most up to total
units, using the primary_distribution
method.
The primary distribution of D-ASA units SHALL be completed between the primary distribution opening and closing dates, according to the primary market.
The primary_distribution
method MUST be called by an authorized primary distribution
entity.
๐ EXAMPLE
The primary market is performed as an auction on a dedicated Algorand Application. The implementation requires the
primary_distribution
method to be called exclusively by the primary market Application, which defines the auctionโs outcome.
๐ EXAMPLE
The primary market is performed as a book building by an authorized Book-builder Address. The implementation requires the
primary_distribution
method to be called exclusively by the authorized Book-builder.
Payment Agent
Debt instruments' cash flows usually involve:
- Principal repayment
- Early repayment options
- Coupon payments
D-ASA supports both on-chain and off-chain payment agents, depending on the settlement asset (see Settlement section).
The D-ASA payment methods MAY provide additional information about the payment.
The payment information could be used, for example, for:
- Adding unique identifiers or external context to the payments
- Enabling external payment system integration in the case of off-chain settlement
- Providing information about the settled amount and conversion rate used with respect to the denomination asset
Principal Repayment
Debt instruments repay the principal according to the repayment schedule.
The principal MUST be repaid according to a principal repayment schedule.
If the D-ASA has coupons, the principal MUST NOT be paid if there is any due coupon still to be paid.
In the case of an on-chain payment agent, the D-ASA MUST repay the principal to the Landerโs Payment Addresses.
Bullet Schedule
If the principal repayment schedule is bullet, the principal MUST be paid
entirely at the maturity date using the pay_principal
method.
Amortizing Schedule
If principal repayment schedule is amortizing, the D-ASA MUST define the
amortization rates as uint16[]
array, where:
-
The length of the array is
N=K+1
, withK
equal to the total coupons; -
The first
K
elements of the array are the amortizing rates associated with coupon payments; -
The last element of the array is the amortization rate associated with principal payment;
-
The elements of the array are expressed in basis points (bps);
-
The sum of all the amortization rates is equal to
10,000
bps.
๐ EXAMPLE
A D-ASA with 5 coupons and even principal amortizing rates has the following amortizing rates (bps):
uint64[] = [2000, 2000, 2000, 2000, 2000, 0]
๐ EXAMPLE
A D-ASA with 5 coupons and a single principal early repayment of 50% has the following amortizing rates (bps):
uint64[] = [0, 0, 5000, 0, 0, 5000]
๐ EXAMPLE
A D-ASA with 4 coupons and different principal amortizing rates (bps):
uint64[] = [1000, 2000, 3000, 4000, 0]
๐ EXAMPLE
The following are invalid amortizing rates, since their sum is not equal to
10,000
bps:
uint64[] = [1000, 2000, 3000, 4000, 5000]
The amortizing rates MUST be set using the OPTIONAL set_amortizing_rates
method.
The amortizing rates MAY be updated with the OPTIONAL set_amortizing_rates
method.
The updated amortizing rates MUST NOT modify past amortizing rates.
The principal MUST be repaid along with coupons, according to the amortizing
rates, using the pay_coupon
method.
The D-ASA unit value MUST be updated according to the outstanding principal.
A reference implementation SHOULD restrict the amortizing rates updatability.
๐ EXAMPLE
Letโs have a D-ASA denominated in EUR, with a principal of 1M EUR and a minimum denomination of 1,000 EUR, 5 coupons, and an even amortizing schedule (20% amortizing rate). The D-ASA has 1,000 total units. The D-ASA initial unit value is 1,000 EUR. The 1st coupon pays both the interest (according to the coupon rates) and 20% of the principal (according to amortizing rates). The D-ASA outstanding principal is 800k EUR. The D-ASA unit value is 800 EUR.
๐ EXAMPLE
Letโs have a D-ASA denominated in EUR, with a principal of 1M EUR and a minimum denomination of 1,000 EUR. The D-ASA originally had 1,000 total units (worth 1,000 EUR each) in circulation. A partial repayment of 500k EUR (50% of the original principal) must be executed pro rata to all lenders. A single amortizing rate of 5,000 bps is used. After the partial repayment, the D-ASA still has 1000 circulating units (worth 500 EUR each).
Early Repayment Options
Debt instruments could have early repayment options to repay the principal to investors (partially or totally) before maturity.
If the debt instrument has early repayment options, the D-ASA MUST implement
the OPTIONAL set_early_repayment_time_events
and early_repayment
methods.
The early repayment options MAY repay the principal partially or totally.
The early repayment options MAY repay the principal to all or some Lenders.
In the case of an on-chain payment agent, the D-ASA MUST repay the principal to the Lander Payment Addresses.
In case of early repayment options, the D-ASA units associated with the early repaid principal MUST be removed from Lendersโ Accounts and circulation.
The implementation SHOULD manage:
- The callability options;
- The accrued interest.
๐ EXAMPLE
Letโs have a D-ASA denominated in EUR, with a principal of 1M EUR and a minimum denomination of 1,000 EUR. The D-ASA originally had 1,000 total units in circulation. An early repayment of 500k EUR (equal to 500 units) is executed for some Lenders. The D-ASA now has 500 circulating units (worth 1,000 EUR each), while 500 early repaid units are removed from circulation.
Early Repayment Schedule
If the D-ASA has early repayment options, it MUST define early repayment
time events as uint64[]
array, where:
-
The length of the array MUST be
N>=2
; -
The first element MUST be the early repayment start date (
uint64
): the time after which early repayment options could be executed; -
The last element MUST be the early repayment end date (
uint64
): the time after which early repayment options cannot be executed.
The early repayment time events MUST be sorted in strictly ascending order.
The early repayment start date MUST NOT be earlier than the issuance date.
The early repayment end date MUST NOT be later than the maturity date.
The early repayment time events SHOULD be defined as UNIX time, in seconds.
If early repayment time events are defined in UNIX time with non-continuous day-count
conventions (ID<255
), the time periods between subsequent events MUST
be multiples of a day, in seconds.
The early repayment time events MUST be set with the set_early_repayment_time_events
method.
The early repayment time events MAY be updated with the set_early_repayment_time_events
method.
The updated early repayment time events MUST NOT modify past events.
Coupons Payment
If the D-ASA has coupons, it MUST pay due coupons, according to the time events,
with the OPTIONAL pay_coupon
method.
The D-ASA MUST pay due coupons, once, to the Landers.
The D-ASA MUST NOT pay coupons before coupon due dates.
In the case of an on-chain payment agent, the D-ASA MUST pay the coupons to the Lander Payment Addresses.
Transfer Agent
Debt instruments can be transferable among investors.
D-ASA supports both on-chain and off-chain transfer agents.
The Transfer Agent SHALL authorize the D-ASA transfers according to the transferability policy.
The transferred D-ASA units MUST be fungible (see D-ASA Units fungibility section).
The transferred D-ASA units MUST record D-ASA unit value and paid coupons.
D-ASA units SHALL NOT be transferred if the sender has pending due coupon payments.
The D-ASA transferability policy may involve and integrate KYC/AML processes, secondary market restrictions, etc.
If the debt instrument is transferable, the D-ASA MUST implement the OPTIONAL
asset_transfer
methods.
The asset_transfer
method MAY be restricted to an authorized Transfer Agent.
Secondary Market
Debt instruments can be traded on secondary markets.
If the debt instrument can be traded on secondary markets, the D-ASA MUST be
transferable and implement the OPTIONAL set_secondary_time_events
.
The D-ASA MUST define secondary market time events as uint64[]
array, where:
-
The length of the array MUST be
N>=1
; -
The first element MUST be the secondary market opening date (
uint64
): the time at which the secondary market opens; -
If the secondary market has a closure date, the last element MUST be the secondary market closure date (
uint64
): the time at which the secondary market closes.
The secondary market time events MUST be sorted in strictly ascending order.
The secondary market opening date MUST NOT be earlier than the issuance date.
The secondary market closure date MUST NOT be later than the maturity date.
The secondary market time events SHOULD be defined as UNIX time, in seconds.
If secondary market time events are defined in UNIX time with non-continuous day-count
conventions (ID<255
), then time periods between subsequent events MUST
be multiples of a day (in seconds).
The secondary market time events MUST be set using the set_secondary_time_events
method.
The secondary market time events MAY be updated with the set_secondary_time_events
method.
The updated secondary market time events MUST NOT modify past events.
The asset_transfer
method MUST fail if the secondary market is closed.
Asset Config
{
"name": "asset_config",
"desc": "Configure the Debt Algorand Standard Application",
"readonly": false,
"args": [
{
"type": "uint64",
"name": "denomination_asset_id",
"desc": "Denomination asset identifier"
},
{
"type": "uint64",
"name": "settlement_asset_id",
"desc": "Settlement asset identifier"
},
{
"type": "uint64",
"name": "principal",
"desc": "Principal, expressed in denomination asset"
},
{
"type": "uint64",
"name": "minimum_denomination",
"desc": "Minimum denomination, expressed in denomination asset"
},
{
"type": "uint8",
"name": "day_count_convention_id",
"desc": "Day-count convention for interests calculation"
},
{
"type": "uint16",
"name": "interest_rate",
"desc": "Interest rates in bps"
},
{
"type": "uint16[]",
"name": "coupon_rates",
"desc": "Coupon interest rates in bps"
},
{
"type": "uint64[]",
"name": "time_events",
"desc": "Time events (strictly ascending order)"
},
{
"type": "(uint64,uint64)[]",
"name": "time_periods",
"desc": "Time periods of recurring time events"
}
],
"returns": {
"type": "void"
},
"errors": [
{
"code": "UNAUTHORIZED",
"message": "Not authorized"
},
{
"code": "ALREADY_CONFIGURED",
"message": "D-ASA already configured"
},
{
"code": "INVALID_MINIMUM_DENOMINATION",
"message": "Minimum denomination is not a divisor of principal"
},
{
"code": "INVALID_DAY_COUNT_CONVENTION",
"message": "Invalid day-count convention ID"
},
{
"code": "INVALID_TIME_EVENTS_LENGTH",
"message": "Time events length is invalid"
},
{
"code": "INVALID_TIME",
"message": "Time events must be set in the future"
},
{
"code": "INVALID_SORTING",
"message": "Time events are not sorted correctly"
},
{
"code": "INVALID_TIME_PERIOD_DURATION",
"message": "Time period durations must be greater than zero"
},
{
"code": "INVALID_SETTLEMENT_ASSET",
"message": "Different settlement asset not supported, must be equal to denomination asset"
},
{
"code": "INVALID_TIME_PERIODS",
"message": "Time periods not properly set"
},
{
"code": "INVALID_TIME_PERIOD_REPETITIONS",
"message": "Time period repetitions not properly set"
},
{
"code": "INVALID_COUPON_RATES",
"message": "Coupon rates not properly set"
}
]
}
The call MUST fail with the UNAUTHORIZED
error code if not called by an authorized
caller.
The call MUST fail with the ALREADY_CONFIGURED
error code if the D-ASA has
been already configured.
The call MUST fail with the INVALID_DENOMINATION
error code if the denomination
asset is not properly set for the specific implementation.
The call MUST fail with the INVALID_MINIMUM_DENOMINATION
error code if the
minimum denomination is not a divisor of the principal.
The call MUST fail with the INVALID_DAY_COUNT_CONVENTION
error code if the
day-count convention ID is invalid.
The call MUST fail with the INVALID_INTEREST_RATE
error code if the interest
rate is not properly set for the specific implementation.
The call MUST fail with the INVALID_TIME_EVENTS_LENGTH
error code if the length
of the time events is not greater than or equal to:
- total coupons +
3
, if the D-ASA has not a defined maturity date; - total coupons +
4
, if the D-ASA has a defined maturity date.
The call MUST fail with the INVALID_TIME
error code if the first time event
is earlier than the latest timestamp (or block height).
The call MUST fail with the INVALID_SORTING
error code if the time events
are not sorted in strictly ascending order.
The call MUST fail with the INVALID_TIME_PERIOD_DURATION
error code if the
time period durations are not strictly greater than zero.
The call MAY fail with the INVALID_SETTLEMENT_ASSET
error code if a settlement
asset different from the denomination asset is not supported by the specific
implementation.
The call MAY fail with the INVALID_TIME_PERIODS
error code if the time periods
are not properly set for the specific implementation.
The call MAY fail with the INVALID_TIME_PERIOD_REPETITIONS
error code if the
time period repetitions are not properly set for the specific implementation.
The call MAY fail with the INVALID_COUPON_RATES
error code if the coupon rates
are not properly set for the specific implementation.
Assign Role
{
"name": "assign_role",
"desc": "Assign a role to an address",
"readonly": false,
"args": [
{
"type": "address",
"name": "role_address",
"desc": "Account Role Address"
},
{
"type": "uint8",
"name": "role",
"desc": "Role identifier"
},
{
"type": "bytes[]",
"name": "config",
"desc": "Role configuration (Optional)"
}
],
"returns": {
"type": "uint64",
"desc": "Timestamp of the role assignment"
},
"errors": [
{
"code": "UNAUTHORIZED",
"message": "Not authorized"
},
{
"code": "DEFAULTED",
"message": "Defaulted"
},
{
"code": "INVALID_ROLE",
"message": "Invalid role identifier"
},
{
"code": "INVALID_ROLE_ADDRESS",
"message": "Invalid account role address"
}
]
}
The call MUST fail with the UNAUTHORIZED
error code if not called by an
authorized.
The call MUST fail with the DEFAULTED
error code if the asset is defaulted.
The call MUST fail with the INVALID_ROLE
error code if the role identifier
is invalid.
The call MUST fail with the INVALID_ROLE_ADDRESS
error code if the role
address has been already assigned to the role.
Revoke Role
{
"name": "revoke_role",
"desc": "Revoke a role from an address",
"readonly": false,
"args": [
{
"type": "address",
"name": "role_address",
"desc": "Account Role Address"
},
{
"type": "uint8",
"name": "role",
"desc": "Role identifier"
}
],
"returns": {
"type": "uint64",
"desc": "Timestamp of the role revocation"
},
"errors": [
{
"code": "UNAUTHORIZED",
"message": "Not authorized"
},
{
"code": "DEFAULTED",
"message": "Defaulted"
},
{
"code": "INVALID_ROLE",
"message": "Invalid role identifier"
},
{
"code": "INVALID_ROLE_ADDRESS",
"message": "Invalid account role address"
}
]
}
The call MUST fail with the UNAUTHORIZED
error code if not called by an authorized
caller or if the operation is not authorized.
The call MUST fail with the DEFAULTED
error code if the asset is defaulted.
The call MUST fail with the INVALID_ROLE
error code if the role identifier
is invalid.
The call MUST fail with the INVALID_ROLE_ADDRESS
error code if the Account
Role Address is invalid.
Open Account
{
"name": "open_account",
"desc": "Open D-ASA account",
"readonly": false,
"args": [
{
"type": "address",
"name": "holding_address",
"desc": "Account Holding Address"
},
{
"type": "address",
"name": "payment_address",
"desc": "Account Payment Address"
}
],
"returns": {
"type": "uint64",
"desc": "Timestamp of the account opening"
},
"errors": [
{
"code": "UNAUTHORIZED",
"message": "Not authorized"
},
{
"code": "DEFAULTED",
"message": "Defaulted"
},
{
"code": "SUSPENDED",
"message": "Suspended operations"
},
{
"code": "INVALID_HOLDING_ADDRESS",
"message": "Invalid account holding address"
}
]
}
The call MUST fail with the UNAUTHORIZED
error code if not called by an authorized
caller or if the operation is not authorized.
The call MUST fail with the DEFAULTED
error code if the asset is defaulted.
The call MAY fail with the SUSPENDED
error code if the asset operations are
suspended.
The call MUST fail with the INVALID_HOLDING_ADDRESS
error code if the Account
already exists.
Close Account
{
"name": "close_account",
"desc": "Close D-ASA account",
"readonly": false,
"args": [
{
"type": "address",
"name": "holding_address",
"desc": "Account Holding Address"
}
],
"returns": {
"type": "(uint64,uint64)",
"desc": "Closed units, Timestamp of the account closing"
},
"errors": [
{
"code": "UNAUTHORIZED",
"message": "Not authorized"
},
{
"code": "DEFAULTED",
"message": "Defaulted"
},
{
"code": "INVALID_HOLDING_ADDRESS",
"message": "Invalid account holding address"
}
]
}
The call MUST fail with the UNAUTHORIZED
error code if not called by an authorized
caller or if the operation is not authorized.
The call MUST fail with the DEFAULTED
error code if the asset is defaulted.
The call MUST fail with the INVALID_HOLDING_ADDRESS
error code if the Account
does not exist.
Set Asset Metadata
{
"name": "set_asset_metadata",
"desc": "Set D-ASA metadata",
"readonly": false,
"args": [
{
"type": "byte[]",
"name": "metadata",
"desc": "Asset metadata"
}
],
"returns": {
"type": "uint64",
"desc": "Timestamp of the set metadata"
},
"errors": [
{
"code": "UNAUTHORIZED",
"message": "Not authorized"
},
{
"code": "DEFAULTED",
"message": "Defaulted"
},
{
"code": "SUSPENDED",
"message": "Asset operations are suspended"
}
]
}
The call MUST fail with the UNAUTHORIZED
error code if not called by an authorized
caller.
The call MUST fail with the DEFAULTED
error code if the asset is defaulted.
The call MAY fail with the SUSPENDED
error code if the asset is suspended.
Set Asset Suspension Status
{
"name": "set_asset_suspension_status",
"desc": "Set asset suspension status",
"readonly": false,
"args": [
{
"type": "bool",
"name": "suspended",
"desc": "Suspension status"
}
],
"returns": {
"type": "uint64",
"desc": "Timestamp of the set asset suspension status"
},
"errors": [
{
"code": "UNAUTHORIZED",
"message": "Not authorized"
}
]
}
The call MUST fail with the UNAUTHORIZED
error code if not called by an authorized
caller.
Set Account Suspension Status
{
"name": "set_account_suspension_status",
"desc": "Set account suspension status",
"readonly": false,
"args": [
{
"type": "address",
"name": "holding_address",
"desc": "Account Holding Address"
},
{
"type": "bool",
"name": "suspended",
"desc": "Suspension status"
}
],
"returns": {
"type": "uint64",
"desc": "Timestamp of the set account suspension status"
},
"errors": [
{
"code": "UNAUTHORIZED",
"message": "Not authorized"
},
{
"code": "INVALID_HOLDING_ADDRESS",
"message": "Invalid account holding address"
}
]
}
The call MUST fail with the UNAUTHORIZED
error code if not called by an authorized
caller.
The call MUST fail with the INVALID_HOLDING_ADDRESS
error code if the Account
does not exist.
Set Default Status
{
"name": "set_default_status",
"desc": "Set D-ASA default status",
"readonly": false,
"args": [
{
"type": "bool",
"name": "defaulted",
"desc": "Default status"
}
],
"returns": {
"type": "uint64",
"desc": "Timestamp of the set status"
},
"errors": [
{
"code": "UNAUTHORIZED",
"message": "Not authorized"
}
]
}
The call MUST fail with the UNAUTHORIZED
error code if not called by an authorized
caller.
Set Amortizing Rates
{
"name": "set_amortizing_rates",
"desc": "Set principal amortizing rates",
"readonly": false,
"args": [
{
"type": "uint64[]",
"name": "amortizing_rates",
"desc": "Principal amortizing rates in bps"
}
],
"returns": {
"type": "uint64",
"desc": "Timestamp of the set rates"
},
"errors": [
{
"code": "UNAUTHORIZED",
"message": "Not authorized"
},
{
"code": "DEFAULTED",
"message": "Defaulted"
},
{
"code": "SUSPENDED",
"message": "Suspended operations"
},
{
"code": "INVALID_AMORTIZING_RATES_LENGTH",
"message": "Amortizing rates length is invalid"
},
{
"code": "INVALID_RATES",
"message": "Sum of amortizing rates must be equal to 10000 bps"
},
{
"code": "INVALID_PAST_RATE",
"message": "Past amortizing rates can not be modified"
}
]
}
The call MUST fail with the UNAUTHORIZED
error code if not called by an authorized
caller.
The call MUST fail with the DEFAULTED
error code if the asset is defaulted.
The call MAY fail with the SUSPENDED
error code if the asset operations are
suspended.
The call MUST fail with the INVALID_AMORTIZING_RATES_LENGTH
error code if
the length of the amortizing rates is not equal to total_coupons plus 1
.
The call MUST fail with the INVALID_RATES
error code if the sum of amortizing
rates is not equal to 10,000 bps.
The call MUST fail with the INVALID_PAST_RATE
error code if a past amortizing
rate is modified.
Set Secondary Time Events
{
"name": "set_secondary_time_events",
"desc": "Set secondary market time schedule",
"readonly": false,
"args": [
{
"type": "uint64[]",
"name": "secondary_market_time_events",
"desc": "Secondary market time events (strictly ascending order)"
}
],
"returns": {
"type": "(uint64, uint64)",
"desc": "Secondary market opening date, Secondary market closure date"
},
"errors": [
{
"code": "UNAUTHORIZED",
"message": "Not authorized"
},
{
"code": "DEFAULTED",
"message": "Defaulted"
},
{
"code": "SUSPENDED",
"message": "Suspended operations"
},
{
"code": "INVALID_TIME_EVENTS_LENGTH",
"message": "Time events length is invalid"
},
{
"code": "INVALID_SORTING",
"message": "Time events are not sorted correctly"
},
{
"code": "INVALID_SECONDARY_OPENING_DATE",
"message": "Invalid secondary market opening date"
},
{
"code": "INVALID_SECONDARY_CLOSURE_DATE",
"message": "Invalid secondary market closure date"
},
{
"code": "INVALID_PAST_EVENT",
"message": "Past time events can not be modified"
}
]
}
The call MUST fail with the UNAUTHORIZED
error code if not called by an authorized
caller.
The call MUST fail with the DEFAULTED
error code if the asset is defaulted.
The call MAY fail with the SUSPENDED
error code if the asset operations are
suspended.
The call MUST fail with the INVALID_TIME_EVENTS_LENGTH
error code if the length
of the time events is not greater than or equal to 1
.
The call MUST fail with the INVALID_SORTING
error code if the time events
are not sorted in strictly ascending order.
The call MUST fail with the INVALID_SECONDARY_OPENING_DATE
error code if the
secondary market opening date is earlier than the issuance date.
The call MUST fail with the INVALID_SECONDARY_CLOSURE_DATE
error code if the
secondary market closure date is earlier than the secondary market opening date
or later than the maturity date.
The call MUST fail with the INVALID_PAST_EVENT
error code if a past event
is modified.
Set Early Repayment Time Events
{
"name": "set_early_repayment_time_events",
"desc": "Set early repayment schedule",
"readonly": false,
"args": [
{
"type": "uint64[]",
"name": "early_repayment_time_events",
"desc": "Early repayment time events (strictly ascending order)"
}
],
"returns": {
"type": "(uint64, uint64)",
"desc": "Early repayments start date, Early repayments end date"
},
"errors": [
{
"code": "UNAUTHORIZED",
"message": "Not authorized"
},
{
"code": "DEFAULTED",
"message": "Defaulted"
},
{
"code": "SUSPENDED",
"message": "Suspended operations"
},
{
"code": "INVALID_TIME_EVENTS_LENGTH",
"message": "Time events length is invalid"
},
{
"code": "INVALID_SORTING",
"message": "Time events are not sorted correctly"
},
{
"code": "INVALID_EARLY_REPAYMENT_START_DATE",
"message": "Invalid early repayment start date"
},
{
"code": "INVALID_EARLY_REPAYMENT_END_DATE",
"message": "Invalid early repayment end date"
},
{
"code": "INVALID_PAST_EVENT",
"message": "Past time events can not be modified"
}
]
}
The call MUST fail with the UNAUTHORIZED
error code if not called by an authorized
caller.
The call MUST fail with the DEFAULTED
error code if the asset is defaulted.
The call MAY fail with the SUSPENDED
error code if the asset operations are
suspended.
The call MUST fail with the INVALID_TIME_EVENTS_LENGTH
error code if the length
of the time events is not greater than or equal to 2
.
The call MUST fail with the INVALID_SORTING
error code if the time events
are not sorted in strictly ascending order.
The call MUST fail with the INVALID_EARLY_REPAYMENT_START_DATE
error code
if the early repayment start date is earlier than the issuance date.
The call MUST fail with the INVALID_EARLY_REPAYMENT_EDN_DATE
error code if
the early repayment end date is later than the maturity date.
The call MUST fail with the INVALID_PAST_EVENT
error code if a past event
is modified.
Primary Distribution
{
"name": "primary_distribution",
"desc": "Distribute D-ASA units to accounts according the primary market",
"readonly": false,
"args": [
{
"type": "address",
"name": "holding_address",
"desc": "Account Holding Address"
},
{
"type": "uint64",
"name": "units",
"desc": "Amount of D-ASA units to distribute"
}
],
"returns": {
"type": "uint64",
"desc": "Remaining D-ASA units to be distributed"
},
"errors": [
{
"code": "UNAUTHORIZED",
"message": "Not authorized"
},
{
"code": "DEFAULTED",
"message": "Defaulted"
},
{
"code": "SUSPENDED",
"message": "Suspended operations"
},
{
"code": "INVALID_HOLDING_ADDRESS",
"message": "Invalid account holding address"
},
{
"code": "ZERO_UNITS",
"message": "Cannot distribute zero units"
},
{
"code": "OVER_DISTRIBUTION",
"message": "Insufficient remaining D-ASA units"
},
{
"code": "PRIMARY_DISTRIBUTION_CLOSED",
"message": "Primary distribution is closed"
}
]
}
The call MUST fail with the UNAUTHORIZED
error code if not called by the authorized
primary market entity.
The call MUST fail with the INVALID_HOLDING_ADDRESS
error code if the Account
associated with the holding address does not exist.
The call MUST fail with the DEFAULTED
error code if the asset is defaulted.
The call MAY fail with the SUSPENDED
error code if the asset operations are
suspended.
The call MUST fail with the ZERO_UNITS
error code if the distributing units
are null.
The call MUST fail with the OVER_DISTRIBUTION
error code if there are no sufficient
remaining D-ASA units for the primary distribution.
The call MUST fail with the PRIMARY_DISTRIBUTION_CLOSED
error code if the
primary distribution is closed.
Pay Principal
{
"name": "pay_principal",
"desc": "Pay the outstanding principal to an account",
"readonly": false,
"args": [
{
"type": "address",
"name": "holding_address",
"desc": "Account Holding Address"
},
{
"type": "byte[]",
"name": "payment_info",
"desc": "Additional payment information (Optional)"
}
],
"returns": {
"type": "(uint64, uint64, byte[])",
"desc": "Paid principal amount in denomination asset, Payment timestamp, Payment context"
},
"errors": [
{
"code": "UNAUTHORIZED",
"message": "Not authorized"
},
{
"code": "DEFAULTED",
"message": "Defaulted"
},
{
"code": "SUSPENDED",
"message": "Suspended operations"
},
{
"code": "INVALID_HOLDING_ADDRESS",
"message": "Invalid account holding address"
},
{
"code": "NO_UNITS",
"message": "No D-ASA units"
},
{
"code": "NOT_MATURE",
"message": "Not mature"
},
{
"code": "PENDING_COUPON_PAYMENT",
"message": "Pending due coupon payment"
}
]
}
A reference implementation SHOULD NOT require an authorized caller.
The call MUST remove D-ASA units from the Account Holding Address and from circulation.
If the call requires authorization, it MUST fail with the UNAUTHORIZED
error
code if not called by an authorized caller.
The call MUST fail with the DEFAULTED
error code if the asset is defaulted.
The call MUST fail with the SUSPENDED
error code if the asset operations are
suspended.
The call MUST fail with the INVALID_HOLDING_ADDRESS
error code if the Account
does not exist.
The call MUST fail with the NO_UNTIS
error code if the Account has no D-ASA
units.
The call MUST fail with the NOT_MATURE
error code if the principal is not
mature.
The call MUST fail with the PENDING_COUPON_PAYMENT
error code if there is
any due coupon still to be paid.
If the D-ASA has on-chain payment agent, the call MUST fail with the NOT_ENOUGH_FUNDS
error code if funds are not enough for the payment.
Pay Coupon
{
"name": "pay_coupon",
"desc": "Pay due coupon to an account",
"readonly": false,
"args": [
{
"type": "address",
"name": "holding_address",
"desc": "Account Holding Address"
},
{
"type": "byte[]",
"name": "payment_info",
"desc": "Additional payment information (Optional)"
}
],
"returns": {
"type": "(uint64, uint64, byte[])",
"desc": "Paid coupon amount in denomination asset, Payment timestamp, Payment context"
},
"errors": [
{
"code": "UNAUTHORIZED",
"message": "Not authorized"
},
{
"code": "DEFAULTED",
"message": "Defaulted"
},
{
"code": "SUSPENDED",
"message": "Suspended operations"
},
{
"code": "INVALID_HOLDING_ADDRESS",
"message": "Invalid account holding address"
},
{
"code": "NO_UNITS",
"message": "No D-ASA units"
},
{
"code": "NO_DUE_COUPON",
"message": "No due coupon to pay"
},
{
"code": "PENDING_COUPON_PAYMENT",
"message": "Pending due coupon payment"
}
]
}
A reference implementation SHOULD NOT require an authorized caller.
If the D-ASA has an amortizing principal payment schedule, the call MUST update the Account's unit value.
If the call requires authorization, it MUST fail with the UNAUTHORIZED
error
code if not called by an authorized caller.
The call MUST fail with the DEFAULTED
error code if the asset is defaulted.
The call MUST fail with the SUSPENDED
error code if the asset operations are
suspended.
The call MUST fail with the INVALID_HOLDING_ADDRESS
error code if the Account
does not exist.
The call MUST fail with the NO_UNTIS
error code if the Account has no D-ASA
units.
The call MUST fail with the NO_DUE_COUPON
error code if there is no due
coupon left to pay for the Account.
The call MUST fail with the PENDING_COUPON_PAYMENT
error code if there is
an old due coupon still to be paid to any account.
If the D-ASA has on-chain payment agent, the call MUST fail with the NOT_ENOUGH_FUNDS
error code if funds are not enough for the payment.
Early Repayment
{
"name": "early_repayment",
"desc": "Pay the principal to an account before maturity",
"readonly": false,
"args": [
{
"type": "address",
"name": "holding_address",
"desc": "Account Holding Address"
},
{
"type": "uint64",
"name": "units",
"desc": "Amount of D-ASA units to repay"
},
{
"type": "byte[]",
"name": "payment_info",
"desc": "Additional payment information (Optional)"
}
],
"returns": {
"type": "(uint64, uint64, byte[])",
"desc": "Paid principal amount in denomination asset, Payment timestamp, Payment information"
},
"errors": [
{
"code": "UNAUTHORIZED",
"message": "Not authorized"
},
{
"code": "DEFAULTED",
"message": "Defaulted"
},
{
"code": "SUSPENDED",
"message": "Suspended operations"
},
{
"code": "INVALID_HOLDING_ADDRESS",
"message": "Invalid account holding address"
},
{
"code": "NO_UNITS",
"message": "No D-ASA units"
},
{
"code": "PENDING_COUPON_PAYMENT",
"message": "Pending due coupon payment for the account"
},
{
"code": "ZERO_UNITS",
"message": "Can not repay zero units"
},
{
"code": "OVER_REPAYMENT",
"message": "Insufficient units to repay for the account"
},
{
"code": "ALREADY_MATURE",
"message": "Already mature"
}
]
}
The call MUST remove D-ASA early rapid units from the Account Holding Address and from circulation.
The call MUST fail with the UNAUTHORIZED
error code if not called by an authorized
caller.
The call MUST fail with the DEFAULTED
error code if the asset is defaulted.
The call MUST fail with the SUSPENDED
error code if the asset operations or
any account involved in the transfers are suspended.
The call MUST fail with the INVALID_HOLDING_ADDRESS
error code if the Sender
or Receiver Holding Address is invalid.
The call MUST fail with the NO_UNTIS
error code if the Account has no D-ASA
units.
The call MUST fail with the PENDING_COUPON_PAYMENT
error code if there is
a due coupon still to be paid for the Account.
The call MUST fail with the ZERO_UNITS
error code if the distributing units
are null.
The call MUST fail with the OVER_REPAYMENT
error code if there are no sufficient
remaining D-ASA units to repay.
The call MUST fail with the ALREADY_MATURE
error code if the principal is
mature.
If the D-ASA has on-chain payment agent, the call MUST fail with the NOT_ENOUGH_FUNDS
error code if funds are not enough for the payment.
Asset Transfer
{
"name": "asset_transfer",
"desc": "Transfer D-ASA units between accounts",
"readonly": false,
"args": [
{
"type": "address",
"name": "sender_holding_address",
"desc": "Sender Account Holding Address"
},
{
"type": "address",
"name": "receiver_holding_address",
"desc": "Receiver Account Holding Address"
},
{
"type": "uint64",
"name": "units",
"desc": "Amount of D-ASA units to transfer"
}
],
"returns": {
"type": "uint64",
"desc": "Transferred actualized value in denomination asset"
},
"errors": [
{
"code": "UNAUTHORIZED",
"message": "Not authorized"
},
{
"code": "DEFAULTED",
"message": "Defaulted"
},
{
"code": "SUSPENDED",
"message": "Suspended operations"
},
{
"code": "INVALID_HOLDING_ADDRESS",
"message": "Invalid account holding address"
},
{
"code": "SECONDARY_MARKET_CLOSED",
"message": "Secondary market is closed"
},
{
"code": "OVER_TRANSFER",
"message": "Insufficient sender units to transfer"
},
{
"code": "NON_FUNGIBLE_UNITS",
"message": "Sender and receiver units are not fungible"
},
{
"code": "PENDING_COUPON_PAYMENT",
"message": "Pending due coupon payment"
}
]
}
The call MUST transfer D-ASA units from the Sender Account Holding Address (removing D-ASA units) to the Receiver Account Holding Address (adding D-ASA units).
The call MUST fail with the UNAUTHORIZED
error code if not called by an authorized
caller.
The call MUST fail with the DEFAULTED
error code if the asset is defaulted.
The call MUST fail with the SUSPENDED
error code if the asset operations or
any account involved in the transfers are suspended.
The call MUST fail with the INVALID_HOLDING_ADDRESS
error code if the Sender
or Receiver Holding Address is invalid.
The call MUST fail with the SECONDARY_MARKET_CLOSED
error code if the secondary
market is closed.
The call MUST fail with the OVER_TRANSFER
error code if the Sender Account
Holding Address has insufficient D-ASA units to transfer.
The call MUST fail with the NON_FUNGIBLE_UNITS
error code if the Sender and
Receiver units are not fungible (e.g. different paid coupons, see D-ASA units fungibility
section).
The call MUST fail with the PENDING_COUPON_PAYMENT
error code if there is
a due coupon still to be paid to the Sender Holding Address.
Update Total Units
{
"name": "update_total_units",
"desc": "Update D-ASA total_units",
"readonly": false,
"args": [
{
"type": "uint64",
"name": "total_units",
"desc": "D-ASA total units"
}
],
"returns": {
"type": "uint64",
"desc": "Timestamp of the update"
},
"errors": [
{
"code": "UNAUTHORIZED",
"message": "Not authorized"
},
{
"code": "DEFAULTED",
"message": "Defaulted"
},
{
"code": "SUSPENDED",
"message": "Asset operations are suspended"
},
{
"code": "PENDING_COUPON_PAYMENT",
"message": "Pending due coupon payment"
}
]
}
The call MUST fail with the UNAUTHORIZED
error code if not called by an authorized
caller.
The call MUST fail with the DEFAULTED
error code if the asset is defaulted.
The call MAY fail with the SUSPENDED
error code if the asset is suspended.
The call MUST fail with the PENDING_COUPON_PAYMENT
error code if there is
any due coupon still to be paid.
Update Global Unit Value
{
"name": "update_global_unit_value",
"desc": "Update D-ASA nominal unit value globally",
"readonly": false,
"args": [
{
"type": "uint64",
"name": "unit_value",
"desc": "D-ASA nominal unit value, expressed in denomination asset"
}
],
"returns": {
"type": "uint64",
"desc": "Timestamp of the update"
},
"errors": [
{
"code": "UNAUTHORIZED",
"message": "Not authorized"
},
{
"code": "DEFAULTED",
"message": "Defaulted"
},
{
"code": "SUSPENDED",
"message": "Asset operations are suspended"
},
{
"code": "PENDING_COUPON_PAYMENT",
"message": "Pending due coupon payment"
}
]
}
The call MUST fail with the UNAUTHORIZED
error code if not called by an authorized
caller.
The call MUST fail with the DEFAULTED
error code if the asset is defaulted.
The call MAY fail with the SUSPENDED
error code if the asset is suspended.
The call MUST fail with the PENDING_COUPON_PAYMENT
error code if there is
any due coupon still to be paid.
Update Interest Rate
{
"name": "update_interest_rate",
"desc": "Update variable interest rates in bps",
"readonly": false,
"args": [
{
"type": "uint16",
"name": "interest_rate",
"desc": "Interest rate in bps"
}
],
"returns": {
"type": "uint64",
"desc": "Timestamp of the update"
},
"errors": [
{
"code": "UNAUTHORIZED",
"message": "Not authorized"
},
{
"code": "DEFAULTED",
"message": "Defaulted"
},
{
"code": "SUSPENDED",
"message": "Asset operations are suspended"
},
{
"code": "PENDING_COUPON_PAYMENT",
"message": "Pending due coupon payment"
}
]
}
The call MUST fail with the UNAUTHORIZED
error code if not called by an authorized
caller.
The call MUST fail with the DEFAULTED
error code if the asset is defaulted.
The call MAY fail with the SUSPENDED
error code if the asset is suspended.
The call MUST fail with the PENDING_COUPON_PAYMENT
error code if there is
any due coupon still to be paid.
Update Coupon Rates
{
"name": "update_coupon_rates",
"desc": "Update variable coupon interest rates in bps",
"readonly": false,
"args": [
{
"type": "uint64[]",
"name": "coupon_rates",
"desc": "Coupon interest rates in bps"
}
],
"returns": {
"type": "uint64",
"desc": "Timestamp of the update"
},
"errors": [
{
"code": "UNAUTHORIZED",
"message": "Not authorized"
},
{
"code": "DEFAULTED",
"message": "Defaulted"
},
{
"code": "SUSPENDED",
"message": "Asset operations are suspended"
},
{
"code": "INVALID_COUPON_RATES_LENGTH",
"message": "Coupon rates length is not equal to total coupons"
},
{
"code": "INVALID_PAST_RATE",
"message": "Due coupon rates can not be modified"
},
{
"code": "PENDING_COUPON_PAYMENT",
"message": "Pending due coupon payment"
}
]
}
The call MUST fail with the UNAUTHORIZED
error code if not called by an authorized
caller.
The call MUST fail with the DEFAULTED
error code if the asset is defaulted.
The call MAY fail with the SUSPENDED
error code if the asset is suspended.
The call MUST fail with the INVALID_COUPON_RATES_LENGTH
error code if the
length of the coupon rates is not equal to total_coupons.
The call MUST fail with the INVALID_PAST_RATE
error code if a due coupon rate
is modified.
The call MUST fail with the PENDING_COUPON_PAYMENT
error code if there is
any due coupon still to be paid.
Update Time Events
{
"name": "update_time_events",
"desc": "Update D-ASA variable time schedule",
"readonly": false,
"args": [
{
"type": "uint64[]",
"name": "time_events",
"desc": "D-ASA time events (strictly ascending order)"
}
],
"returns": {
"type": "(uint64, uint64, uint64, uint64, uint64)",
"desc": "Primary distribution opening date, Primary distribution closure date, Issuance date, Maturity date, Timestamp of the update"
},
"errors": [
{
"code": "UNAUTHORIZED",
"message": "Not authorized"
},
{
"code": "DEFAULTED",
"message": "Defaulted"
},
{
"code": "SUSPENDED",
"message": "Suspended operations"
},
{
"code": "INVALID_TIME_EVENTS_LENGTH",
"message": "Time events length is invalid"
},
{
"code": "INVALID_TIME",
"message": "Time events must be set in the future"
},
{
"code": "INVALID_SORTING",
"message": "Time events are not sorted correctly"
},
{
"code": "INVALID_PAST_EVENT",
"message": "Past time events can not be modified"
},
{
"code": "PENDING_COUPON_PAYMENT",
"message": "Pending due coupon payment"
}
]
}
The call MUST fail with the UNAUTHORIZED
error code if not called by an authorized
caller.
The call MUST fail with the DEFAULTED
error code if the asset is defaulted.
The call MAY fail with the SUSPENDED
error code if the asset is suspended.
The call MUST fail with the INVALID_TIME_EVENTS_LENGTH
error code if the length
of the time events is not equal to total_coupons plus 4
.
The call MUST fail with the INVALID_TIME
error code if the first time event
is earlier than the latest timestamp (or block height).
The call MUST fail with the INVALID_SORTING
error code if the time events
are not sorted in strictly ascending order.
The call MUST fail with the INVALID_PAST_EVENT
error code if a past event
is modified.
The call MUST fail with the PENDING_COUPON_PAYMENT
error code if there is
any due coupon still to be paid.
Update Time Periods
{
"name": "update_time_periods",
"desc": "Update D-ASA variable time periods",
"readonly": false,
"args": [
{
"type": "(uint64,uint64)[]",
"name": "time_periods",
"desc": "D-ASA time periods"
}
],
"returns": {
"type": "uint64",
"desc": "Timestamp of the update"
},
"errors": [
{
"code": "UNAUTHORIZED",
"message": "Not authorized"
},
{
"code": "DEFAULTED",
"message": "Defaulted"
},
{
"code": "SUSPENDED",
"message": "Suspended operations"
},
{
"code": "INVALID_TIME_PERIOD",
"message": "Time period durations must be greater than zero"
},
{
"code": "PENDING_COUPON_PAYMENT",
"message": "Pending due coupon payment"
}
]
}
The call MUST fail with the UNAUTHORIZED
error code if not called by an authorized
caller.
The call MUST fail with the DEFAULTED
error code if the asset is defaulted.
The call MAY fail with the SUSPENDED
error code if the asset is suspended.
The call MUST fail with the INVALID_TIME_PERIOD
error code if the time period
durations are not strictly greater than zero.
The call MUST fail with the PENDING_COUPON_PAYMENT
error code if there is
any due coupon still to be paid.
Get Asset Info
{
"name": "get_asset_info",
"desc": "Get D-ASA info",
"readonly": true,
"args": [],
"returns": {
"type": "(uint64,uint64,uint64,uint64,uint8,uint16,uint64,uint64,uint64, uint64,uint64,uint64,bool,bool)",
"desc": "Denomination asset ID, Settlement asset ID, Outstanding principal, Unit nominal value, Day-count convention, Interest rate, Total supply, Circulating supply, Primary distribution opening date, Primary distribution closure date, Issuance date, Maturity date, Suspended, Defaulted"
}
}
Get Asset Metadata
{
"name": "get_asset_metadata",
"desc": "Get D-ASA metadata",
"readonly": true,
"args": [],
"returns": {
"type": "byte[]",
"desc": "Asset metadata"
}
}
Get Account Info
{
"name": "get_account_info",
"desc": "Get account account info",
"readonly": true,
"args": [
{
"type": "address",
"name": "holding_address",
"desc": "Account Holding Address"
}
],
"returns": {
"type": "(address,uint64,uint64,uint64,bool)",
"desc": "Payment Address, D-ASA units, Unit nominal value in denomination asset, Paid coupons, Suspended"
},
"errors": [
{
"code": "INVALID_HOLDING_ADDRESS",
"message": "Invalid Holding Address"
}
]
}
The call MUST fail with the INVALID_HOLDING_ADDRESS
error code if the Sender
or Receiver Holding Address is invalid.
Get Account Units Value
{
"name": "get_account_units_value",
"desc": "Get account's units nominal value",
"readonly": true,
"args": [
{
"type": "address",
"name": "holding_address",
"desc": "Account Holding Address"
},
{
"type": "uint64",
"name": "units",
"desc": "Account's units for the nominal value calculation"
}
],
"returns": {
"type": "uint64",
"desc": "Units nominal value in denomination asset"
},
"errors": [
{
"code": "NO_PRIMARY_DISTRIBUTION",
"message": "Primary distribution not yet executed"
},
{
"code": "INVALID_HOLDING_ADDRESS",
"message": "Invalid Holding Address"
},
{
"code": "INVALID_UNITS",
"message": "Invalid amount of units for the account"
}
]
}
The call MUST fail with the NO_PRIMARY_DISTRIBUTION
error code if the method
is called before the primary distribution opening date.
The call MUST fail with the INVALID_HOLDING_ADDRESS
error code if the Sender
or Receiver Holding Address is invalid.
The call MUST fail with the INVALID_UNTIS
error code if the unit value is
greater than Account D-ASA units.
Get Account Units Current Value
{
"name": "get_account_units_current_value",
"desc": "Get account's current units value and accrued interest",
"readonly": true,
"args": [
{
"type": "address",
"name": "holding_address",
"desc": "Account Holding Address"
},
{
"type": "uint64",
"name": "units",
"desc": "Account's units for the current value calculation"
}
],
"returns": {
"type": "(uint64,uint64,(uint64,uint64))",
"desc": "Units current value in denomination asset, Accrued interest in denomination asset, (Day count factor numerator, Day count factor denominator)"
},
"errors": [
{
"code": "NO_PRIMARY_DISTRIBUTION",
"message": "Primary distribution not yet executed"
},
{
"code": "INVALID_HOLDING_ADDRESS",
"message": "Invalid Holding Address"
},
{
"code": "INVALID_UNITS",
"message": "Invalid amount of units for the account"
},
{
"code": "PENDING_COUPON_PAYMENT",
"message": "Pending due coupon payment for the account"
}
]
}
The call MUST fail with the NO_PRIMARY_DISTRIBUTION
error code if the method
is called before the primary distribution opening date.
The call MUST fail with the INVALID_HOLDING_ADDRESS
error code if the Sender
or Receiver Holding Address is invalid.
The call MUST fail with the INVALID_UNTIS
error code if the unit value is
greater than Account D-ASA units.
If the D-ASA has coupons, the call MUST fail with the PENDING_COUPON_PAYMENT
error code if there is an old due coupon still to be paid to any account.
The accrued interest MUST 0
if the method is called before the issuance
date.
If the D-ASA has fixed coupons, the accrued interest MUST be 0
after all
coupons are due.
If the D-ASA has zero coupons, the accrued interest MUST be 0
after the
maturity date.
Get Roles
{
"name": "get_roles",
"desc": "Get role identifiers",
"readonly": true,
"args": [],
"returns": {
"type": "uint8[]",
"desc": "Role identifiers"
}
}
Get Role Config
{
"name": "get_role_config",
"desc": "Get role configuration",
"readonly": true,
"args": [
{
"type": "address",
"name": "role_address",
"desc": "Account Role Address"
},
{
"type": "uint8",
"name": "role",
"desc": "Role identifier"
}
],
"returns": {
"type": "bytes[]",
"desc": "Role configuration"
},
"errors": [
{
"code": "INVALID_ROLE",
"message": "Invalid role identifier"
},
{
"code": "INVALID_ROLE_ADDRESS",
"message": "Invalid account role address"
}
]
}
Get Time Events
{
"name": "get_time_events",
"desc": "Get D-ASA time events",
"readonly": true,
"args": [],
"returns": {
"type": "uint64[]",
"desc": "Time events"
}
}
Get Time Periods
{
"name": "get_time_periods",
"desc": "Get D-ASA time periods",
"readonly": true,
"args": [],
"returns": {
"type": "(uint64,uint64)[]",
"desc": "Time periods"
}
}
Get Payment Amount
{
"name": "get_payment_amount",
"desc": "Get the next payment amount",
"readonly": true,
"args": [
{
"type": "address",
"name": "holding_address",
"desc": "Account Holding Address"
}
],
"returns": {
"type": "(uint64,uint64)",
"desc": "Interest amount in denomination asset, Principal amount in denomination asset"
},
"errors": [
{
"code": "INVALID_HOLDING_ADDRESS",
"message": "Invalid Holding Address"
}
]
}
The getter MUST return the next payment amount for the account or 0
if there
is no payment to execute for the account.
The getter MUST return the interest and the principal components separately.
๐ EXAMPLE
Let's have a D-ASA with
4
coupons. The account already received2
coupon payments. The getter returns the interest amount of the 3rd coupon.
๐ EXAMPLE
Let's have a D-ASA with
4
coupons and a principal amortizing schedule. The account already received2
coupon payments. The getter returns the interest amount of the 3rd coupon and the amortized principal.
๐ EXAMPLE
Let's have a D-ASA with
4
coupons and principal at maturity. The account already received4
coupon payments. The getter returns the amount of the principal repayment.
๐ EXAMPLE
Let's have a D-ASA with zero coupons and principal at maturity. The principal is not yet mature. The getter returns the amount of the principal repayment.
๐ EXAMPLE
Let's have a D-ASA with perpetual coupons and no callable principal. The account already received
N
coupon payments. The getter returns the interest amount of theN+1
coupon.
Get Coupon Rates
{
"name": "get_coupons_rates",
"desc": "Get D-ASA coupon rates",
"readonly": true,
"args": [],
"returns": {
"type": "uint16[]",
"desc": "Coupon rates"
}
}
Get Coupons Status
{
"name": "get_coupons_status",
"desc": "Get D-ASA coupons status",
"readonly": true,
"args": [],
"returns": {
"type": "(uint64,uint64,uint64,(uint64,uint64),bool)",
"desc": "Total coupons, Due coupons, Next coupon due date, (Day count factor numerator, Day count factor denominator) , All coupons due paid"
}
}
The next coupon due date value MUST be 0
if all coupons are due.
The day count factor values MUST 0
if the method is called before the issuance
date or if all coupons are due.
Get Amortizing Rates
{
"name": "get_amortizing_rates",
"desc": "Get D-ASA principal amortizing rates",
"readonly": true,
"args": [],
"returns": {
"type": "uint64[]",
"desc": "Principal amortizing rates"
}
}
Get Secondary Market Schedule
{
"name": "get_secondary_market_schedule",
"desc": "Get secondary market schedule",
"readonly": true,
"args": [],
"returns": {
"type": "uint64[]",
"desc": "Secondary market schedule"
}
}
Get Early Repayment Schedule
{
"name": "get_early_repayment_schedule",
"desc": "Get early repayment schedule",
"readonly": true,
"args": [],
"returns": {
"type": "uint64[]",
"desc": "Early repayment schedule"
}
}
Rationale
This standard has been designed to support different types of debt instruments and their payoffs, with cash-flows executed both on-chain and off-chain.
The standard fosters modularity, with high degree of flexibility with respect to the integration of external components (Applications), such as KYC, auctions, order-books, off-chain transfer agents, etc.
The specification makes sure that the trust model and RBAC of D-ASA implementations can range from trustless versions (e.g., payments triggered automatically if the conditions are met, default called automatically on payment failure) to trusted ones (e.g., payments triggered only by authorized entities, default called manually by a trustee).
The implementation of the specified interfaces is left to the use-cases, which may cherry-pick a subset of methods and getters based on their requirements.
Reference Implementation
โ ๏ธThe reference implementations have not been audited. Do not use this code for real products. The author declines all responsibility.
The reference implementation provides the following features:
-
RBAC:
- Arranger: creates, configures and updates the D-ASA
- Account Manager: opens and closes accounts (proxy a KYC process)
- Primary Dealer: performs the primary distribution on the primary market
- Trustee: can call a default
- Authority: can suspend accounts or the whole asset
- Interest Oracle: can update the interest rate in case of variable rates
-
Denomination:
- ASA
-
Payment Agent:
- On-chain (ASA)
-
Day-count conventions:
- Actual/Actual (time periods must be in days, i.e., multiples of
86400
seconds) - Continuous
- Actual/Actual (time periods must be in days, i.e., multiples of
-
Transfer Agent:
- On-chain
- Direct (i.e., from investor to investor)
-
Secondary market
-
Notarize metadata (e.g. prospectus)
-
Updatable program (restricted to the Arranger)
Deployments
D-ASA examples deployed on TestNet:
Payoff | App ID | App Spec |
---|---|---|
Zero Coupon Bond | 732462799 | ARC-32 |
Fixed Coupon Bond | 732462811 | ARC-32 |
Perpetual Bond | 732462812 | ARC-32 |
- Download the App Spec JSON file;
- Navigate to the Lora App Lab;
- Create the App Interface using the existing App ID and App Spec JSON;
- Explore the D-ASA interface.
Zero Coupon Bond
Property | Option |
---|---|
Denomination | On-chain (ASA) |
Principal repayment | At maturity |
Early repayment options | No |
Interest | Fixed |
Coupons | No |
Time Schedule | Fixed (Events) |
Day-Count Convention | Actual/Actual, Continuous |
Primary Distribution | Direct placement |
Primary Market | Placed at nominal value |
Transfer Agent | Trustless |
Payment Agent | Trustless |
Secondary Market | Yes |
Default | Manual (Trustee) |
Payment Agent
Payments are trustless (i.e., can be triggered by anyone), as long as payments' conditions are met (e.g., the payment is due).
Default
Called manually by the trustee.
Fixed Coupon Bond
Property | Option |
---|---|
Denomination | On-chain (ASA) |
Principal repayment | At maturity |
Early repayment options | No |
Interest | Fixed |
Coupons | Yes (Fixed) |
Time Schedule | Fixed (Events) |
Day-Count Convention | Actual/Actual, Continuous |
Primary Distribution | Direct placement |
Primary Market | Placed at nominal value |
Transfer Agent | Trustless |
Payment Agent | Trustless |
Secondary Market | Yes |
Default | Manual (Trustee) |
Payment Agent
Payments are trustless (i.e., can be triggered by anyone), as long as payments' conditions are met (e.g., the payment is due).
A coupon payment cannot be executed until all the previous due coupons (if any) have been paid to all the investors.
Transfer Agent
D-ASA units cannot be transferred until all the pending due coupon payments for the sender and receiver (if any) have been executed.
Default
Called manually by the trustee.
Perpetual Bond
Property | Option |
---|---|
Denomination | On-chain (ASA) |
Principal repayment | Not callable |
Early repayment options | No |
Interest | Variable (Interest Oracle) |
Coupons | Yes (Perpetual) |
Time Schedule | Fixed (Events, Periods) |
Day-Count Convention | Actual/Actual, Continuous |
Primary Distribution | Direct placement |
Primary Market | Placed at nominal value |
Transfer Agent | Trustless |
Payment Agent | Trustless |
Secondary Market | Yes |
Default | Manual (Trustee) |
Payment Agent
Payments are trustless (i.e., can be triggered by anyone), as long as payments' conditions are met (e.g., the payment is due).
A coupon payment cannot be executed until all the previous due coupons (if any) have been paid to all the investors.
Transfer Agent
D-ASA units cannot be transferred until all the pending due coupon payments for the sender and receiver (if any) have been executed.
Interest Rate
Updated by the interest oracle.
Interest rate cannot be updated until all the previous due coupons (if any) have been paid to all the investors.
Default
Called manually by the trustee.
Tests
The D-ASA project is developed with AlgoKit.
- Install AlgoKit
- Setup your virtual environment (managed with Poetry)
algokit bootstrap all
- Start your Algorand LocalNet (requires Docker)
algokit localnet start
- Run tests (managed with PyTest)
algokit project run test
or, for verbose results:
poetry run pytest -s -v tests/<contract_name>/<test_case>.py
Contributors
- Cosimo Bassi (@cusma)
License
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU Affero General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero General Public License from time to time. Such new versions
will be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU Affero General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU Affero General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU Affero General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see
<https://www.gnu.org/licenses/>.