Margin
The margin endpoints can be used to open or close a short position in a certain asset. Short positions at BOTS are bound by certain business rules, to reduce risk for the platform, which are outlined below.
Notice that the restrictions on tradable assets are not applied in the paper trading environment. This means that you can use the paper trading environment to test all the strategies that you can think of! If a certain strategy performs well, but goes outside the bounds of the rules above, you can always reach out to the Bot Creators team at BOTS to discuss the opportunity.
[POST] loans/take
Description
Take a loan in a certain asset, to facilitate a short position.
Parameters
(Body)
Name | Type | Description | Mandatory |
---|---|---|---|
asset | string | The asset in which the loan will be taken. | Yes |
amount | string | The amount of the asset that should be loaned. | Yes* (if takeMaxLoan is not provided or false) |
timestamp | string | Timestamp of the request. | Yes |
takeMaxLoan | boolean | When true, the API gives the maximum possible amount of loan, and the amount parameter is ignored. This is a convenience flag. | No |
[POST] loans/repay
Description
Repay a loan in a certain asset, to facilitate the closing of a short position.
Parameters
(Body)
Name | Type | Description | Mandatory |
---|---|---|---|
asset | string | The asset in which the loan will be taken. | Yes |
amount | string | The amount of the asset that should be loaned. | Yes |
timestamp | string | Timestamp of the request. | Yes |
[GET] loans/limits
Description
Returns estimation of the current total loan and maximum total loan over all balances of the bot, converted to a certain asset.
Parameters
(Body)
Name | Type | Description | Mandatory |
---|---|---|---|
asset | string | The asset in which the loan will be taken. | Yes |
timestamp | string | Timestamp of the request. | Yes |
Response
(Body)
Name | Type | Description |
---|---|---|
asset | string | The asset in which the loan limits are displayed. |
maxLoanPercentage | string | The percentage of total assets of the bot that can be loaned by this bot. |
currentTotalLoanSize | string | The size of the current total loan, converted to the requested asset. |
maxTotalLoanSize | string | The maximum loan that this bot can currently take, converted to the requested asset. |