Loans
Events
ConfiscateCollateralAndDebit
Attributes
Name |
Type |
Composition |
owner |
T::AccountId |
AccountId |
collateral_type |
CurrencyId |
{'Token': ('ACA', 'AUSD', 'DOT', 'LDOT', 'TAP', 'KAR', 'KUSD', 'KSM', 'LKSM', 'TAI', 'BNC', 'VSKSM', 'PHA', 'KINT', 'KBTC'), 'DexShare': ({'Token': ('ACA', 'AUSD', 'DOT', 'LDOT', 'TAP', 'KAR', 'KUSD', 'KSM', 'LKSM', 'TAI', 'BNC', 'VSKSM', 'PHA', 'KINT', 'KBTC'), 'Erc20': '[u8; 20]', 'LiquidCrowdloan': 'u32', 'ForeignAsset': 'u16', 'StableAssetPoolToken': 'u32'}, {'Token': ('ACA', 'AUSD', 'DOT', 'LDOT', 'TAP', 'KAR', 'KUSD', 'KSM', 'LKSM', 'TAI', 'BNC', 'VSKSM', 'PHA', 'KINT', 'KBTC'), 'Erc20': '[u8; 20]', 'LiquidCrowdloan': 'u32', 'ForeignAsset': 'u16', 'StableAssetPoolToken': 'u32'}), 'Erc20': '[u8; 20]', 'StableAssetPoolToken': 'u32', 'LiquidCrowdloan': 'u32', 'ForeignAsset': 'u16'} |
confiscated_collateral_amount |
Balance |
u128 |
deduct_debit_amount |
Balance |
u128 |
PositionUpdated
Attributes
Name |
Type |
Composition |
owner |
T::AccountId |
AccountId |
collateral_type |
CurrencyId |
{'Token': ('ACA', 'AUSD', 'DOT', 'LDOT', 'TAP', 'KAR', 'KUSD', 'KSM', 'LKSM', 'TAI', 'BNC', 'VSKSM', 'PHA', 'KINT', 'KBTC'), 'DexShare': ({'Token': ('ACA', 'AUSD', 'DOT', 'LDOT', 'TAP', 'KAR', 'KUSD', 'KSM', 'LKSM', 'TAI', 'BNC', 'VSKSM', 'PHA', 'KINT', 'KBTC'), 'Erc20': '[u8; 20]', 'LiquidCrowdloan': 'u32', 'ForeignAsset': 'u16', 'StableAssetPoolToken': 'u32'}, {'Token': ('ACA', 'AUSD', 'DOT', 'LDOT', 'TAP', 'KAR', 'KUSD', 'KSM', 'LKSM', 'TAI', 'BNC', 'VSKSM', 'PHA', 'KINT', 'KBTC'), 'Erc20': '[u8; 20]', 'LiquidCrowdloan': 'u32', 'ForeignAsset': 'u16', 'StableAssetPoolToken': 'u32'}), 'Erc20': '[u8; 20]', 'StableAssetPoolToken': 'u32', 'LiquidCrowdloan': 'u32', 'ForeignAsset': 'u16'} |
collateral_adjustment |
Amount |
i128 |
debit_adjustment |
Amount |
i128 |
TransferLoan
Attributes
Name |
Type |
Composition |
from |
T::AccountId |
AccountId |
to |
T::AccountId |
AccountId |
currency_id |
CurrencyId |
{'Token': ('ACA', 'AUSD', 'DOT', 'LDOT', 'TAP', 'KAR', 'KUSD', 'KSM', 'LKSM', 'TAI', 'BNC', 'VSKSM', 'PHA', 'KINT', 'KBTC'), 'DexShare': ({'Token': ('ACA', 'AUSD', 'DOT', 'LDOT', 'TAP', 'KAR', 'KUSD', 'KSM', 'LKSM', 'TAI', 'BNC', 'VSKSM', 'PHA', 'KINT', 'KBTC'), 'Erc20': '[u8; 20]', 'LiquidCrowdloan': 'u32', 'ForeignAsset': 'u16', 'StableAssetPoolToken': 'u32'}, {'Token': ('ACA', 'AUSD', 'DOT', 'LDOT', 'TAP', 'KAR', 'KUSD', 'KSM', 'LKSM', 'TAI', 'BNC', 'VSKSM', 'PHA', 'KINT', 'KBTC'), 'Erc20': '[u8; 20]', 'LiquidCrowdloan': 'u32', 'ForeignAsset': 'u16', 'StableAssetPoolToken': 'u32'}), 'Erc20': '[u8; 20]', 'StableAssetPoolToken': 'u32', 'LiquidCrowdloan': 'u32', 'ForeignAsset': 'u16'} |
Storage functions
Positions
Python
result = substrate.query(
'Loans', 'Positions', [
{
'DexShare': (
{
'Erc20': '[u8; 20]',
'ForeignAsset': 'u16',
'LiquidCrowdloan': 'u32',
'StableAssetPoolToken': 'u32',
'Token': (
'ACA',
'AUSD',
'DOT',
'LDOT',
'TAP',
'KAR',
'KUSD',
'KSM',
'LKSM',
'TAI',
'BNC',
'VSKSM',
'PHA',
'KINT',
'KBTC',
),
},
{
'Erc20': '[u8; 20]',
'ForeignAsset': 'u16',
'LiquidCrowdloan': 'u32',
'StableAssetPoolToken': 'u32',
'Token': (
'ACA',
'AUSD',
'DOT',
'LDOT',
'TAP',
'KAR',
'KUSD',
'KSM',
'LKSM',
'TAI',
'BNC',
'VSKSM',
'PHA',
'KINT',
'KBTC',
),
},
),
'Erc20': '[u8; 20]',
'ForeignAsset': 'u16',
'LiquidCrowdloan': 'u32',
'StableAssetPoolToken': 'u32',
'Token': (
'ACA',
'AUSD',
'DOT',
'LDOT',
'TAP',
'KAR',
'KUSD',
'KSM',
'LKSM',
'TAI',
'BNC',
'VSKSM',
'PHA',
'KINT',
'KBTC',
),
},
'AccountId',
]
)
Return value
{'collateral': 'u128', 'debit': 'u128'}
TotalPositions
Python
result = substrate.query(
'Loans', 'TotalPositions', [
{
'DexShare': (
{
'Erc20': '[u8; 20]',
'ForeignAsset': 'u16',
'LiquidCrowdloan': 'u32',
'StableAssetPoolToken': 'u32',
'Token': (
'ACA',
'AUSD',
'DOT',
'LDOT',
'TAP',
'KAR',
'KUSD',
'KSM',
'LKSM',
'TAI',
'BNC',
'VSKSM',
'PHA',
'KINT',
'KBTC',
),
},
{
'Erc20': '[u8; 20]',
'ForeignAsset': 'u16',
'LiquidCrowdloan': 'u32',
'StableAssetPoolToken': 'u32',
'Token': (
'ACA',
'AUSD',
'DOT',
'LDOT',
'TAP',
'KAR',
'KUSD',
'KSM',
'LKSM',
'TAI',
'BNC',
'VSKSM',
'PHA',
'KINT',
'KBTC',
),
},
),
'Erc20': '[u8; 20]',
'ForeignAsset': 'u16',
'LiquidCrowdloan': 'u32',
'StableAssetPoolToken': 'u32',
'Token': (
'ACA',
'AUSD',
'DOT',
'LDOT',
'TAP',
'KAR',
'KUSD',
'KSM',
'LKSM',
'TAI',
'BNC',
'VSKSM',
'PHA',
'KINT',
'KBTC',
),
},
]
)
Return value
{'collateral': 'u128', 'debit': 'u128'}
Constants
PalletId
Value
'0x6163612f6c6f616e'
Python
constant = substrate.get_constant('Loans', 'PalletId')
Errors
AmountConvertFailed