Any Stake Protocol is designed to unify callable methods and data state between different 'staking-like' dapps
@Callable(i)
func adminRegisterAsset() = {}
# payment in $baseAssetId
@Callable(i)
func submitPut() = {}
# payment in $shareAssetId
@Callable(i)
func submitGet() = {}
@Callable(i)
func executePut(baseTokenStr: String, userAddressStr: String, txId: String) = {}
@Callable(i)
func executeGet(baseTokenStr: String, userAddressStr: String, txId: String) = {}
# if amount > 0 then payment in $baseAssetId
# if amount < 0 then empty payments
# if amount = 0 then error
@Callable(i)
func topUpBalance(baseAssetId: String, amount: Int) = {}
@Callable(i)
func currentSysParamsREST(baseTokenId: String)={}
# includes current price
Because of key length restriction (max 100 symbols) we need to introduce $internalBaseAssetId and bidirectional mappings between it and real assetId
Num | Key | Type | Optional? | Format and Description |
---|---|---|---|---|
1 | %s%s%d__mappings__internal2baseAssetId__${internalBaseAssetId} |
String | No | Simple |
2 | %s%s%s__mappings__baseAsset2internalId__${baseAssetId} |
String | No | Simple |
Type | Format |
---|---|
Key | %s%s%s__config__asset__${realBaseAssetId} |
Value | %s%d%d%d%d__${shareAssetId}__${internalBaseAssetId}__${decimalsMultBothTokens}__${decimalsMultPrice}__${getDelayBlocks}__...dataExtensions... |
Extensions:
Type | Format |
---|---|
Key | %s%d%s%s__P__${internalBaseAssetId}__${userAddress}__${txId} |
Value | %s%d%d%d%d%d%d%d__${status}__${inBaseTokensAmount}__${price}__${outShareTokensAmount}__${startHeight}__${startTimestamp}__${endHeight}__${endTimestamp}...dataExtensions... |
Extensions:
Type | Format |
---|---|
Key | %s%d%s%s__G__${internalBaseAssetId}__${userAddress}__${txId} |
Value | %s%d%d%d%d%d%d%d__${status}__${inShareTokensAmount}__${price}__${outBaseTokensAmount}__${startHeight}__${startTimestamp}__${endHeight}__${endTimestamp}...dataExtensions... |
Extensions:
Num | Key | Type | Optional? | Format | Description |
---|---|---|---|---|---|
1 | %s%s%s__mappings__share2baseAssetId__${shareAssetId} |
String | NO | Simple | mapping between ${shareAssetId} and real ${baseAssetId} |
2 | %s%s%s__mappings__baseAsset2shareId__${baseAssetId} |
String | NO | Simple | mapping between ${baseAssetId} and real ${shareAssetId} |
3 | %s%s%d%s__total__locked__${internalBaseAssetId}__${userAddress} |
String | YES | %d%d__${sharedTokenAmount}__${baseTokenAmount} |
|
4 | %s%s%d__total__locked__${internalBaseAssetId} |
String | NO | %d%d__${sharedTokenAmount}__${baseTokenAmount} |
|
5 | %s%s%d%d%d__price__history__${intrenalBaseAssetId}__${height}__${timestamp} |
Integer | YES | Simple | It is difficult to use ${decimalsMult} from asset config because assets with 0 decimals will have bad price (300/200=1.5 ~ 1) ${decimalsMultPrice} has been introduce to resolve this problem |
6 | %s%s%d__price__last__${internalBaseAssetId} |
Integer | NO | Simple | |
7 | %s%s%d__shutdown__put__${internalBaseAssetId} |
Boolean | Yes | Simple. If true then put operation is blocked |
- Dapp:
3P6SFR9ZZwKHZw5mMDZxpXHEhg1CXjBb51y
wavesexplorer OR w8io- USDTLP token id:
9AT2kEi8C4AYxV1qKxtQTVpD5i54jCPvaNNRP6VzRtYZ
wavesexplorer OR w8io - USDCLP token id:
CrjhbC9gRezwvBZ1XwPQqRwx4BWzoyMHGFNUVdn22ep6
wavesexplorer OR w8io - BTCLP token id:
DazN41oAedqwGZ8aabf4nJQwJNZhsEgPH3YQWDtPsdeV
wavesexplorer OR w8io - ETHLP token id:
ELzXTgPa6GGYyLtitn2oWDWQ9joyTFEueNtF4kxg95dM
wavesexplorer OR w8io
- USDTLP token id:
No extensions, see corresponding
- both one step operations (No need to send claim/execute/withdraw by user)
- ${status} - always FINISHED
- ${startHeight} == ${endHeight}
- ${startTimestamp} == ${endTimestamp}
- Dapp:
3PKaRXj6pBb23A8k965eEgBAhhJ4FSDKS5e
wavesexplorer OR w8io- AUSDTLPM token id:
3iAUM9xnKdu2TWBXRqPvYoGsbiZEbDPP1okUf5v9RJNz
wavesexplorer OR w8io - ABTCLPM token id:
4NyYnDGopZvEAQ3TcBDJrJFWSiA2xzuAw83Ms8jT7WuK
wavesexplorer OR w8io - AETHLPM token id:
Hp4dcR5hYUkrAUrNPazSWEFnt5rUr2suxa2AMo4KsFEf
wavesexplorer OR w8io - AUSDCLPM token id:
A9h1bQ2ycMPmS85Dp5NECymsoJ48ZrK8eThdECJZW94b
wavesexplorer OR w8io
- AUSDTLPM token id:
Type | Format |
---|---|
Key | Config V_01.key |
Value |
Config V_01.val __${TopupIntervalInBlocks}__${TopupMaxNegativePart}__${TopupManagerAddress}__${SubmitLimitsBaseMax}__${SubmitLimitsBaseReset}__${SubmitLimitsShareMax}__${SubmitLimitsShareReset}
|
Type | Format |
---|---|
Key | submitPut V_01.key |
Value | submitPut V_01.val__${topUpIdxUnlock} |
- two step operation
- the following data is available only after corresponding
executeXxx
call${endHeight}
${endTimestamp}
${price}
${outShareTokensAmount}
Type | Format |
---|---|
Key | submitGet V_01.key |
Value | submitGet V_01.val__${topUpIdxUnlock} |
- two step operation
- the following data is available only after corresponding
executeXxx
call${endHeight}
${endTimestamp}
${price}
${outBaseTokensAmount}
Same logic as ALGO Medium but more risks
- Dapp:
3PDepwsPLPmFTGQM3H51jbR9b5522eM9kth
wavesexplorer OR w8io- AUSDTLPA token id:
K9hzUfVF4Koc5BoihpK1v6GXEpukERCEHNuSRNt83F9
wavesexplorer OR w8io - AUSDCLPA token id:
7TiEKGoXwFXiQCKqj8773QJFY4tCrK3Yku9Q4zenJdPn
wavesexplorer OR w8io
- AUSDTLPA token id:
- Dapp:
3P3hCvE9ZfeMnZE6kXzR6YBzxhxM8J6PE7K
wavesexplorer OR w8io- USDTLAMBO token id:
4K35syPfY2tYrNWzjh1vbmH39qE4qPV7SwLwekrzD82r
wavesexplorer OR w8io - USDCLAMBO token id:
FaCgK3UfvkRF2WfFyKZRVasMmqPRoLG7nUv8HzR451dm
wavesexplorer OR w8io
- USDTLAMBO token id:
same as ALGO config
same as ALGO submitPut
with one exception as ALGO submitGet:
-
${endHeight}
is available right away aftersubmitGet
and calculated as${currentBlockchainHeight} + .${getDelayBlocks}
(see Config V_01). It is used to block operation till this height.
Similar logic as ALGO Medium
- Dapp:
3PLDtdSudp3ao5WWU4EzXC6D7TQm7t3dSWC
wavesexplorer OR w8io- ABTCLPC token id:
B1dG9exXzJdFASDF2MwCE7TYJE5My4UgVRx43nqDbF6s
wavesexplorer OR w8io - AETHLPC token id:
J7UiL1tgEfPaHkrLCirqoyu4v6rVMDc6yPEV95ixorVB
wavesexplorer OR w8io - AUSDCLPC token id:
VGLLW8XE5wyMU9NzKNn1s3qSx9AJ1oG8j1xzgwKnaZv
wavesexplorer OR w8io - AUSDTLPC token id:
EemDhgzLQ57hjFbNGYkPJtCnSz5eP2YdMa6H4Pum92z8
wavesexplorer OR w8io
- ABTCLPC token id: